/**
 * @description: 用户管理
 * @fileName: index
 * @author: xsz
 * @date: 2023/2/9-13:04
 * @version: V1.0.0
 **/
import request from '@/utils/request'
import routes from '../gateway-routes'

/** 查询管理员列表 三级阅卷人 */
export function getAdminInfo(page, size, params) {
  return request({
    url: `${routes.auth}/adminInfo/select?page=${page}&size=${size}`,
    method: 'get',
    params
  })
}

/** 创建账号*/
export function createAccount(data) {
  return request({
    url: `${routes.auth}/adminInfo/createAccounts`,
    method: 'post',
    params: data
  })
}

/** 新增考生账户*/
export function saveExaminee(data) {
  return request({
    url: `${routes.auth}/adminInfo/saveExaminee`,
    method: 'post',
    data
  })
}
/** 批量导入考生账号*/
export function importExaminee(data) {
  return request({
    url: `${routes.auth}/adminInfo/upload/excel`,
    method: 'post',
    data
  })
}

/** 修改-新增管理员信息*/
export function changeAdminInfo(data) {
  return request({
    url: `${routes.auth}/adminInfo/save`,
    method: 'post',
    data: data
  })
}

/** 删除管理员*/
export function deleteAdminInfo(id) {
  return request({
    url: `${routes.auth}/adminInfo/del`,
    method: 'post',
    params: { id: id }
  })
}

/** 导入用户文件 */
export function importUser(data) {
  return request({
    url: `${routes.auth}/adminInfo/import`,
    method: 'post',
    data
  })
}
/** 导出用户文件 */
export function exportUser(data) {
  return request({
    url: `${routes.auth}/adminInfo/exportAdminList`,
    method: 'post',
    responseType: 'blob',
    params: data
  })
}

/** 获取操作日志数据*/
export function querySystemLog(data, page, size) {
  return request({
    url: `${routes.auth}/sysLog/find?page=${page}&size=${size}`,
    method: 'get',
    params: data
  })
}

/** 考生登录记录导出 */
export function exportLastLogin(data) {
  return request({
    url: `${routes.auth}/sysLog/exportLastLogin`,
    method: 'get',
    responseType: 'blob',
    params: data
  })
}

/** 获取字典数据*/
export function queryDictionary(data) {
  return request({
    url: `api/${routes.comDictionary}/queryByType`,
    method: 'post',
    data
  })
}
/** 删除字典数据*/
export function deleteDictionary(data) {
  return request({
    url: `${routes.comDictionary}/del`,
    method: 'post',
    params: data
  })
}
/** 新增字典数据*/
export function addDictionary(data) {
  return request({
    url: `${routes.comDictionary}/add`,
    method: 'post',
    data
  })
}
/** 修改字典数据*/
export function updateDictionary(data) {
  return request({
    url: `${routes.comDictionary}/upd`,
    method: 'post',
    data
  })
}
/** 查询个人信息*/
export function queryExamineeInfo(data) {
  return request({
    url: `${routes.csexam}/info/query`,
    method: 'get',
    params: data
  })
}

/** 导入鉴定点要素 */
export function importChapter(data) {
  return request({
    url: `${routes.csexam}/qbChapter/importChapter`,
    method: 'post',
    data
  })
}

/** 查询题库字典(无方法) */
export function selectComExceptMethod(data) {
  return request({
    url: `${routes.auth}/comDictionary/selectComExceptMethod`,
    method: 'get',
    data
  })
}

